package annotationdemo;

import java.util.ArrayList;
import java.util.List;

public class Person {

    private String name;
    private String gender;
    private String birthday;

    public Person() {
    }

    public Person(String name, String gender, String birthday) {
        this.name = name;
        this.gender = gender;
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    @Override //重写了Object类的toString()方法
    public String toString() {
        return super.toString();
    }

    //@Override //错误因为此方法不是重写父类的方法
    /*
    public void sayHello() {

    }*/

    @Deprecated //表示此方法已经被废弃不推荐使用。
    public void sayHello(){
        System.out.println("how are you?");
    }

    @SuppressWarnings({"unchecked","rawtypes"})
    public void initPersons(){
        List list = new ArrayList();
        list.add(new Person());
    }
}
